3.9.23 \(\int (-a-b x)^{-n} (a+b x)^n \, dx\) [823]

Optimal. Leaf size=21 \[ x (-a-b x)^{-n} (a+b x)^n \]

[Out]

x*(b*x+a)^n/((-b*x-a)^n)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {23, 8} \begin {gather*} x (-a-b x)^{-n} (a+b x)^n \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^n/(-a - b*x)^n,x]

[Out]

(x*(a + b*x)^n)/(-a - b*x)^n

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 23

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((c_) + (d_.)*(v_))^(n_), x_Symbol] :> Dist[(a + b*v)^m/(c + d*v)^m, Int[u*
(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[b*c - a*d, 0] &&  !(IntegerQ[m] || IntegerQ[n
] || GtQ[b/d, 0])

Rubi steps

\begin {align*} \int (-a-b x)^{-n} (a+b x)^n \, dx &=\left ((-a-b x)^{-n} (a+b x)^n\right ) \int 1 \, dx\\ &=x (-a-b x)^{-n} (a+b x)^n\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 21, normalized size = 1.00 \begin {gather*} x (-a-b x)^{-n} (a+b x)^n \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^n/(-a - b*x)^n,x]

[Out]

(x*(a + b*x)^n)/(-a - b*x)^n

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 26, normalized size = 1.24

method result size
norman \(x \,{\mathrm e}^{n \ln \left (b x +a \right )} {\mathrm e}^{-n \ln \left (-b x -a \right )}\) \(26\)
risch \(x \left (b x +a \right )^{n} {\mathrm e}^{-n \left (i \pi \mathrm {csgn}\left (i \left (b x +a \right )\right )^{3}-i \pi \mathrm {csgn}\left (i \left (b x +a \right )\right )^{2}+i \pi +\ln \left (b x +a \right )\right )}\) \(55\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^n/((-b*x-a)^n),x,method=_RETURNVERBOSE)

[Out]

x*exp(n*ln(b*x+a))/exp(n*ln(-b*x-a))

________________________________________________________________________________________

Maxima [A]
time = 0.33, size = 5, normalized size = 0.24 \begin {gather*} \left (-1\right )^{n} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/((-b*x-a)^n),x, algorithm="maxima")

[Out]

(-1)^n*x

________________________________________________________________________________________

Fricas [A]
time = 0.80, size = 6, normalized size = 0.29 \begin {gather*} x \cos \left (\pi n\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/((-b*x-a)^n),x, algorithm="fricas")

[Out]

x*cos(pi*n)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (15) = 30\).
time = 1.90, size = 44, normalized size = 2.10 \begin {gather*} \begin {cases} - \frac {a \left (- a - b x\right )^{- n} \left (a + b x\right )^{n}}{b} + x \left (- a - b x\right )^{- n} \left (a + b x\right )^{n} & \text {for}\: b \neq 0 \\a^{n} x \left (- a\right )^{- n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**n/((-b*x-a)**n),x)

[Out]

Piecewise((-a*(a + b*x)**n/(b*(-a - b*x)**n) + x*(a + b*x)**n/(-a - b*x)**n, Ne(b, 0)), (a**n*x/(-a)**n, True)
)

________________________________________________________________________________________

Giac [A]
time = 1.38, size = 1, normalized size = 0.05 \begin {gather*} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/((-b*x-a)^n),x, algorithm="giac")

[Out]

x

________________________________________________________________________________________

Mupad [B]
time = 1.26, size = 21, normalized size = 1.00 \begin {gather*} \frac {x\,{\left (a+b\,x\right )}^n}{{\left (-a-b\,x\right )}^n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x)^n/(- a - b*x)^n,x)

[Out]

(x*(a + b*x)^n)/(- a - b*x)^n

________________________________________________________________________________________